package com.qin.springcloud;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.cloud.client.circuitbreaker.EnableCircuitBreaker;
import org.springframework.cloud.netflix.eureka.EnableEurekaClient;
import org.springframework.context.annotation.Bean;

import com.netflix.hystrix.contrib.metrics.eventstream.HystrixMetricsStreamServlet;

@SpringBootApplication
@EnableEurekaClient
@EnableCircuitBreaker
public class UsersProvider_8001_hystrix {
	public static void main(String[] args) {
		SpringApplication.run(UsersProvider_8001_hystrix.class, args);
	}

	@Bean
	@SuppressWarnings("rawtypes")
	public ServletRegistrationBean registrationBean() {
    	@SuppressWarnings("unchecked")
		ServletRegistrationBean registrationBean = new ServletRegistrationBean(new HystrixMetricsStreamServlet());
    	registrationBean.addUrlMappings("/actuator/hystrix.stream");
    	return registrationBean;
    }
}
